#! /bin/bash

# Author: Faisal Abu-Nimeh
# Mod Date: 20140306
# Description: (runs on DAQ workstation(s) via apple remote desktop) run daqServer and getEccClient on mm*. This files moves old graws to previousGraw directory. It kills previous instances of these processes.


myIP=`ifconfig en0|grep 'inet '|cut -d ' ' -f 2`
#echo IP is $myIP
sdir=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
source $sdir/GETUP

killall getEccServer
killall daqServer

# sudo ifconfig en0 mtu 8982

cd $sdir/runtime
mkdir -p previousGraw
mv *.graw previousGraw

echo "Starting ECC Server"
getEccServer -a $myIP -r $myIP &

echo "Starting DAQ Server"
daqServer $myIP &

echo "running... waiting..."

